<template>
  <div class="home">
    <input type="text" v-model="keyWords">
    <button @click="send">发送请求</button>
  </div>
</template>

<script>
// @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue'
import axios from 'axios'
import {ref} from 'vue'
export default {
//   name: 'HomeView',
  components: {
    // HelloWorld
  },
  setup(){
    const keyWords = ref('')
    const send=()=>{
        // get请求  问号后面是参数  参数以键值对存在  
    axios.get('/a/suggest?word='+keyWords.value).then(res=>{
        console.log(res)
    })

    }
    
    return {keyWords,send}
  }
}
</script>
